package com.zliuyno.rpcdemo.rpc;

import java.util.concurrent.ConcurrentHashMap;

public class Dispatcher {

    private static Dispatcher dis = null;

    static {
        dis = new Dispatcher();
    }

    public static Dispatcher getDis(){
        return dis;
    }


    private Dispatcher(){}

    ConcurrentHashMap<String, Object> invokeMap = new ConcurrentHashMap<>();

    public void register(String k, Object o) {
        invokeMap.put(k, o);
    }

    public Object get(String k) {
        return invokeMap.get(k);
    }
}